/* 
 * File:   PluginCtrlPane.h
 * Author: hao
 *
 * Created on 2011年5月14日, 下午2:37
 * 
 * PluginCtrlPane function set
 * unsigned getArgCount()
 * const char * getArgInformation( unsinged index );
 * bool getIntArgRange( unsigned index, int * pMax, int * pMin );
 * bool getDoubleArgRange( unsigned index, double * pMax, double * pMin );
 * bool getIntArgData( unsigned index, int * pout );
 * bool getDoubleArgData( unsigned index, double * pout );
 * unsigned getStringArgDataLength( unsigned index );
 * bool getStringArgData( unsigned index, const char * pout );
 * bool setIntArgData( unsigned index, int data );
 * bool setDoubleArgData( unsigned index, double data );
 * bool setCharArgData( unsigned index, const char * data );
 * 
 */

#ifndef PLUGINCTRLPANE_H
#define	PLUGINCTRLPANE_H

namespace PluginDefaultType{
    enum{
        EQ = 0,
    };
}

#include <cstring>
#include <string>
using std::string;

class PluginCtrlPane {
public:
    PluginCtrlPane( const string & Path );
    virtual ~PluginCtrlPane();
    
    int getType();
    unsigned getArgCount();
    const char * getArgInformation( unsigned ArgIndex );
    bool getIntArgRange( unsigned ArgIndex, int * pMax, int * pMin );
    bool getDoubleArgRange( unsigned ArgIndex, double * pMax, double * pMin );
    bool getIntArgData( unsigned ArgIndex, int * pout );
    bool getDoubleArgData( unsigned ArgIndex, double * pout );
    unsigned getStringArgDataLength( unsigned ArgIndex );
    bool getStringArgData( unsigned ArgIndex, char * pout );
    bool setIntArgData( unsigned index, int data );
    bool setDoubleArgData( unsigned index, double data );
    bool setStringArgData( unsigned index, const char * data );

    bool Init();

private:
    
    void * PluginCtrlPaneHandle;
    string patch;

    int (*getTypeFunction)();
    unsigned ( *getArgCountFunction)();
    const char * (*getArgInformationFunction)(unsigned index);
    bool ( *getIntArgRangeFunction)(unsigned index, int * pMax, int * pMin);
    bool ( *getDoubleArgRangeFunction)(unsigned index, double * pMax, double * pMin);
    bool ( *getIntArgDataFunction)(unsigned index, int * pout);
    bool (*getDoubleArgDataFunction)(unsigned index, double * pout);
    unsigned (*getStringArgDataLengthFunction)(unsigned index);
    bool (*getStringArgDataFunction)(unsigned index, char * pout);
    bool (*setIntArgDataFunction)(unsigned index, int data);
    bool (*setDoubleArgDataFunction)(unsigned index, double data);
    bool (*setStringArgDataFunction)(unsigned index, const char * data);

};

#endif	/* PLUGINCTRLPANE_H */

